<!DOCTYPE html>
<html lang="en">
<head>
  <title>largest-contentful-paint</title>
</head>
<body>
  <img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="">
  <script>
    var observer = new PerformanceObserver(function (list) {
      var perfEntries = list.getEntries();
      for (var i = 0; i < perfEntries.length; i++) {
        console.log(perfEntries[i].toJSON())
      }
    });
    observer.observe({entryTypes: ['largest-contentful-paint']});
  </script>
</body>
</html>